Skip to content

Q1-05: split core/commands.py - #493

Merged
sknampally merged 1 commit into
developfrom
q1/commands-package
Nov 28, 2026
Merged

sknampally merged 1 commit into
developfrom
q1/commands-package

Conversation

@sknampally

Copy link
Copy Markdown
Collaborator

Q1-05 (#454), part of #449.

src/reframe/core/commands.py (952 lines) is now the package reframe.core.commands, with one module per command group:

Module Commands
starting run, resume, claude, the worker
reading status, events, report, compare
answering answer
reconciling reconcile, review
designing design, export
sharing publish, reports
tearing_down teardown
  • The tests pass unchanged. The shared helpers (say, _fail, _prompt, _start_worker, find_run) stay in the package. The command modules look them up through the package, and the commands that start others too. So mock.patch.object(commands, "_start_worker") and the other Q1-04 patches still reach every command. All 461 tests pass with no test file changed.
  • The code is unchanged. I compared each of the 36 original definitions with its new copy: they are identical apart from the commands. lookups and one renamed variable.
  • The mypy override list is now empty. reframe.core.commands is off it. Checking the package found one fault: in the worker's three exception handlers, stop was reused after its except Stop as stop block. Those branches now name it failure; the behaviour is unchanged.
  • CONTRIBUTING now says mypy checks every module.

Checked locally with the dev extra:

  • ruff check src tests: passes.
  • mypy: no issues in 96 files.
  • coverage run -m unittest discover -s tests -t .: 461 tests pass, 81% total against the floor of 80.
  • reframe --help runs.

Prepared with AI assistance.

The 952-line module is now a package, reframe.core.commands, with one
module per command group: starting (run, resume, claude, the worker),
reading (status, events, report, compare), answering, reconciling
(reconcile, review), designing (design, export), sharing (publish,
reports) and tearing_down.

- The shared helpers (say, _fail, _prompt, _start_worker, find_run) stay
  in the package. The command modules look them up, and the commands
  that start others, through the package, so reframe.core.commands.<name>
  is still the one place a test replaces each. The Q1-04 tests and every
  other test pass unchanged (461).
- Every function body is the original's, apart from that lookup.
  Checked mechanically against the old file.
- reframe.core.commands is off the mypy override list, which is now
  empty. Checking it found one fault: in the worker's handlers, `stop`
  was reused after its except block. Those branches now name it
  `failure`; the behaviour is unchanged.
- CONTRIBUTING says mypy checks every module.

Prepared with AI assistance.
@sknampally
sknampally merged commit 42bf9c8 into develop Nov 28, 2026
10 checks passed
@sknampally
sknampally deleted the q1/commands-package branch November 28, 2026 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant